﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Asset/EassetMaster.master" AutoEventWireup="true"
    CodeBehind="FixedAssetItemDetailsForm.aspx.cs" Inherits="Eassets.UI.Asset.FixedAssetItemDetailsForm" %>

<%@ Register Src="~/Components/FlashMessage.ascx" TagName="FlashMessage" TagPrefix="osm" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    <script type="text/javascript" language="javascript">
        function handleNumbersOnly(e) {
            // Allowed: 0-9 [48-57], "." [46], "," [44], "<backspace>" [8], "<tab>" [9]
            var charCode = (e.which) ? e.which : e.keyCode
            if (charCode != 9) { //Allow tab
                if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                    if (charCode == 46 || charCode == 44 || e.which == 0) {
                        return true; //Valid Entry
                    }
                    else {
                        return false; //Invalid Entry
                    }
                }
                else {
                    return true; //Valid entry
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="formtitle">
        <asp:Label ID="labelFormTitle" runat="server" Text="Asset Item Details"></asp:Label>
         <osm:FlashMessage ID="FlashMessage2" runat="server" />
    </div>
    <fieldset>
        <ul class="form">
            <li>
                <div class="formfield">
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="labelOrganizationLevelList" runat="server" Text="Organization Level List"
                                    CssClass="legendlabel_size2"></asp:Label>
                                <asp:DropDownList ID="dropDownListOrganizationLevelList" runat="server" CssClass="select"
                                    AutoPostBack="true">
                                    <asp:ListItem Value="1" Text="-Select-"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                            </td>
                            <td align="right" width="">
                                <asp:Label ID="labelnoOfItems" runat="server" Text="No. of Items" CssClass="legendlabel_size2"></asp:Label>
                                <asp:TextBox ID="textBoxnoOfItems" runat="server" CssClass="disable_textbox1" Width="80px"
                                    MaxLength="8"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelMainCategory" runat="server" Text="Main Category" CssClass="legendlabel_size2"></asp:Label>
                    <asp:DropDownList ID="dropDownListMainCategory" runat="server" CssClass="select"
                        AutoPostBack="true">
                        <asp:ListItem Value="1" Text="-Select-"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelSubCategory" runat="server" Text="Sub Category" CssClass="legendlabel_size2"></asp:Label>
                    <asp:DropDownList ID="dropDownListSubCategory" runat="server" CssClass="select" AutoPostBack="true">
                        <asp:ListItem Value="1" Text="-Select-"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelAsset" runat="server" Text="Asset" CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxAsset" runat="server" CssClass="disable_textbox1" Width="180px"
                        MaxLength="8"></asp:TextBox>
                    <%-- <asp:Button ID="buttonAsset" runat="server" Text="..." CssClass="button_browse" />--%>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="labelDepreciationMethod" runat="server" Text="Depreciation Method"
                                    CssClass="legendlabel_size2"></asp:Label>
                                <asp:TextBox ID="textBoxDepreciationMethod" runat="server" CssClass="disable_textbox1"
                                    Width="100px" MaxLength="8"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="labelDepreciationRate" runat="server" Text="Depre. Rate" CssClass="legendlabel_size2"></asp:Label>
                                <asp:TextBox ID="textBoxDepreciationRate" runat="server" CssClass="disable_textbox1"
                                    Width="60px" MaxLength="8"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
            </li>
        </ul>
    </fieldset>
    <br></br>
    <fieldset>
        <ul class="form">
            <li>
                <div>
                    <asp:GridView ID="gridViewItemDetails" runat="server" Caption="Asset Item Details"
                        CssClass="ColStyle" EmptyDataText="No data to display" AllowPaging="True" PageSize="10"
                        AutoGenerateColumns="false" Width="100%" OnPageIndexChanging="gridViewItemDetails_PageIndexChanging"
                        OnRowCreated="gridViewItemDetails_OnRowCreated">
                        <AlternatingRowStyle CssClass="AltRowStyle" />
                        <HeaderStyle CssClass="GridHeader" />
                        <SelectedRowStyle CssClass="SelectedRowStyle" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:CheckBox runat="server" ID="checkBoxHeader" AutoPostBack="true" OnCheckedChanged="checkBoxHeader_CheckedChanged" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="checkBoxItem" AutoPostBack="true" OnCheckedChanged="checkBoxItem_CheckedChanged"
                                        Width="10px" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="" DataField="ItemDetailsId" ItemStyle-Width="40" />
                            <asp:BoundField HeaderText="Item Serial" DataField="AssetSerialCode" ItemStyle-Width="120"
                                ItemStyle-HorizontalAlign="Right" />
                            <asp:BoundField HeaderText="PurchasedDate" DataField="PurchasedDate" ItemStyle-Width="120"
                                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:d}" />
                            <%-- <asp:TemplateField HeaderText="Pu. Date" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <asp:TextBox ID="textBoxPuDate" runat="server" CssClass="textbox_customsize" Width="80px"
                                        MaxLength="5" Text='<%# Eval("PurchasedDate","{0:M/dd/yyyy}")%>' OnTextChanged="textBoxPurchaseDate_OnTextChange"></asp:TextBox>
                                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="textBoxPuDate">
                                    </asp:CalendarExtender>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:BoundField HeaderText="PurchasedValue" DataField="PurchasedValue" ItemStyle-Width="120"
                                ItemStyle-HorizontalAlign="Right" />
                            <%-- <asp:TemplateField HeaderText="Pu. Value">
                                <ItemTemplate>
                                    <asp:TextBox ID="textBoxPuValue" runat="server" CssClass="textbox_customsize" Width="80px"
                                        MaxLength="10" Text='<%# Eval("PurchasedValue")%>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:BoundField HeaderText="Cumulative Dep. Value" DataField="CumulativeDepValue"
                                ItemStyle-Width="120" />
                            <asp:BoundField HeaderText="Current Book Value" DataField="CurrentBookValue" ItemStyle-Width="140" />
                            <asp:BoundField HeaderText="Remaining Life Time" DataField="RemainingLifeTime" ItemStyle-Width="140" />
                            <asp:BoundField HeaderText="Owner" DataField="EmployeeID" ItemStyle-Width="120" ItemStyle-HorizontalAlign="Right" />
                            <%--<asp:TemplateField HeaderText="Owner" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td style="text-align: center">
                                                <asp:TextBox ID="textBoxOwner" runat="server" CssClass="textbox_customsize" Width="80px"
                                                    MaxLength="5" Text='<%# Eval("EmployeeID")%>'></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:Button ID="ButtonBarCodeFormat" runat="server" Text="..." CssClass="button_browse" />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:BoundField HeaderText="Warranty" DataField="Warranty" ItemStyle-Width="120"
                                ItemStyle-HorizontalAlign="Right" />
                            <%-- <asp:TemplateField HeaderText="Warranty">
                                <ItemTemplate>
                                    <asp:TextBox ID="textBoxWarranty" runat="server" CssClass="textbox_customsize" Width="60px"
                                        MaxLength="5" Text='<% # Eval("Warranty")%>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:BoundField HeaderText="Bar Code" DataField="Barcode" ItemStyle-Width="120" ItemStyle-HorizontalAlign="Right" />
                            <%-- <asp:TemplateField HeaderText="Bar Code">
                                <ItemTemplate>
                                    <asp:TextBox ID="textBoxBarCode" runat="server" CssClass="textbox_customsize" Width="80px"
                                        MaxLength="5" ItemStyle-Width="80" Text='<%# Eval("Barcode")%>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <%-- <asp:HiddenField id="hiddenFieldAssetItemId" runat="server"></asp:HiddenField>--%>
                        </Columns>
                    </asp:GridView>
                </div>
            </li>
        </ul>
    </fieldset>
    <br />
    <%-- <fieldset visible="false">--%>
    <%--<ul class="form">--%>
    <fieldset>
        <legend>Apply Item Serials</legend>
        <%--<ul class="form">
            <li>
                <div class="formfield">
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="labelPrefix" runat="server" Text="Prefix" CssClass="legendlabel_size2"></asp:Label>
                                <asp:CheckBox ID="CheckBoxPrefix" runat="server" />
                                <asp:TextBox ID="textBoxPrefix" runat="server" CssClass="textbox_customsize" Width="80px"
                                    MaxLength="5"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="labelSuffix" runat="server" Text="Suffix"></asp:Label>
                                <asp:CheckBox ID="CheckBoxSuffix" runat="server" />
                                <asp:TextBox ID="textBoxSuffix" runat="server" CssClass="textbox_customsize" Width="80px"
                                    MaxLength="5"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
            </li>
        </ul>--%>
        <ul class="form">
            <osm:FlashMessage ID="FlashMessage1" runat="server" />
            <li>
                <div class="formfield">
                    <asp:Label ID="labelPurchasedDate" runat="server" Text="Purchased Date" CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxPurchasedDate" runat="server" CssClass="textbox_customsize"
                        Width="100px" MaxLength="5"></asp:TextBox>
                    <asp:Label ID="LabelErrorDate" runat="server" Text="Date cannot be a Future Date."
                        Visible="false"></asp:Label>
                    <asp:Label ID="labelPurchasedDateStar" runat="server" Text="*" CssClass="mandatoryfield"></asp:Label>
                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="textBoxPurchasedDate">
                    </asp:CalendarExtender>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelPurchasedValue" runat="server" Text="Purchased Value" CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxPurchasedValue" runat="server" CssClass="textbox_customsizeNum"
                        Width="100px" MaxLength="10" OnTextChanged="PurchaseValue_OnTextChange" AutoPostBack="true"></asp:TextBox>
                    <asp:Label ID="labelPurchasedValueStar" runat="server" Text="*" CssClass="mandatoryfield"></asp:Label>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelDepreciationValue" runat="server" Text="Depreciation Value" CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxDepreciationValue" runat="server" CssClass="textbox_customsizeNum"
                        Width="100px" MaxLength="5"></asp:TextBox>
                    <asp:Label ID="labelDepreciationValueStar" runat="server" Text="*" CssClass="mandatoryfield"></asp:Label>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelCumilativeDepValue" runat="server" Text="Cumilative Depriciation Value"
                        CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxCumilativeDepValue" runat="server" CssClass="textbox_customsizeNum"
                        Width="100px" MaxLength="5"></asp:TextBox>
                    <asp:Label ID="labelCumilativeDepValueStar" runat="server" Text="*" CssClass="mandatoryfield"></asp:Label>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelCurrentBookValue" runat="server" Text="Current Book Value" CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxCurrentBookValue" runat="server" CssClass="textbox_customsizeNum"
                        Width="100px" MaxLength="5"></asp:TextBox>
                    <asp:Label ID="labelCurrentBookValueStar" runat="server" Text="*" CssClass="mandatoryfield"></asp:Label>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelRemainingLifeTime" runat="server" Text="Remaining Life Time"
                        CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxRemainingLifeTime" runat="server" CssClass="textbox_customsizeNum"
                        Width="100px" MaxLength="5"></asp:TextBox>
                    <asp:Label ID="labelRemainingLifeTimeStar" runat="server" Text="*" CssClass="mandatoryfield"></asp:Label>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="buttonlist2">
                    <asp:Button ID="buttonSave" runat="server" Text="Save" CssClass="button_normal" OnClick="buttonSave_OnClick" />
                    <asp:Button ID="buttonCancel" runat="server" Text="Cancel" CssClass="button_normal" />
                </div>
            </li>
        </ul>
    </fieldset>
    <br />
</asp:Content>
